package com.designCreator.model
{
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.events.ResultEvent;
	
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	public class FeedProxy extends Proxy implements IProxy, IResponder
	{
		public static const NAME : String = "FeedProxy";
		
		public function FeedProxy( data : Object = null )
		{
			super( NAME, data );
		}
		
		public function result( event : Object ) : void
		{
			feed.assign( ResultEvent( event ).result as Feed );
			//sendNotification( NotificationNames.LOAD_FEED_SUCCESS );
		}
		
		public function fault( event : Object ) : void
		{
			//sendNotification( NotificationNames.LOAD_FEED_FAILURE );
		}
		
		public function get feed() : Feed
		{
			return data as Feed;
		}
		
		public function set feed( value : Feed ) : void
		{
			data = value;
			if ( !value.loaded )
			{
				/*var delegate : LoadFeedDelegate = new LoadFeedDelegate();
				var token : AsyncToken = delegate.send( value.url );
				token.addResponder( this );*/
			}
		}
	}
}